import lejos.nxt.Button;
import lejos.nxt.Motor;
import lejos.nxt.SensorPort;
import lejos.nxt.comm.RConsole;

public class Main {
    public static boolean USE_BLUETOOTH = true;

    public static void main(String[] args) {
	if (Main.USE_BLUETOOTH == true)
	    RConsole.openBluetooth(0);

	PathFollower follower = new PathFollower(SensorPort.S2, SensorPort.S4,
		SensorPort.S1, Motor.C, Motor.A);
	System.out.println("CALIBRATE ON TRACK");
	Button.waitForPress();
	System.out.println(follower.calibrateOnPath());

	System.out.println("CALIBRATE OFF TRACK");
	Button.waitForPress();
	System.out.println(follower.calibrateOffPath());

	System.out.println("CALIBRATE COMPASS");
	Button.waitForPress();
	follower.calibrateCompass();

	follower.setSpeed(900);

	System.out.println("RUN");
	Button.waitForPress();
	follower.run();
	RConsole.close();
    }

}
